<!DOCTYPE html>
<html>
<head>
    {{template "header"}}
</head>
<body>
<script>
    webix.ready(function () {
        let formid = webix.uid()
        webix.ui({
            rows: [
                wxui.getPageToolbar({
                    icon: "mdi mdi-cogs",
                    title: "系统设置",
                    elements: [
                        wxui.getIconButton("保存", 130, "content-save", false, function () {
                            let param = $$(formid).getValues();
                            webix.ajax().post("{{.prefix}}/config/save", param).then(function (result) {
                                let resp = result.json();
                                webix.message({type: resp.msgtype, text: resp.msg, expire: 5000});
                                if (resp.code === 0) {

                                }
                            })
                        }),
                    ]
                }),
                {
                    rows: [
                        {
                            id: formid,
                            view: "property",
                            editable: true,
                            complexData: true,
                            url: "{{.prefix}}/config/info.json",
                            elements: [
                                {label: "RADIUS 配置", type: "label"},
                                {label: "忽略密码", type: "combo", options: ["enabled", "disabled"], id: "radius.RadiusIgnorePwd"},
                                {label: "日志记录", type: "combo", options: ["all", "none", "success", "failure"], id: "radius.RadiusAuthlogLevel"},
                                {
                                    label: "日志留存(天)",
                                    type: "combo",
                                    options: ["10", "30", "60", "90", "120", "150", "180"],
                                    id: "radius.RadiuslogHistoryDays"
                                },
                            ]
                        }
                    ]
                }
            ]
        })
    })
</script>
</body>
</html>